<template>
  <div>
    <el-table
      :data="listdata"
      border
      class="el_table tab_main"
      empty-text="暂无数据"
      @selection-change="handleSelectionChange"
    >
      <template v-for="colConfig in configs">
        <slot v-if="colConfig.slot" :name="colConfig.slot" />
        <el-table-column v-bind="colConfig" />
      </template>
    </el-table>
  </div>
</template>
<script>
export default {
  props: ["configs", "listdata"],
  mounted() {
    console.log(this.colConfigs);
    console.log(this.listdata);
  },
  methods: {
    handleSelectionChange(val) {
      this.$emit("handleSelectionChange", this.childData);
      return val;
    }
  }
};
</script>
